home *** CD-ROM | disk | FTP | other *** search
- cd.device Test
- Written by John J. Szucs
- Copyright © 1993-1999 Amiga, Inc.
- All Rights Reserved
-
- Introduction
- ============
-
- cd.device is the test program for cd.device, the CD-ROM device driver
- in the Amiga CD32 and other future Amiga systems equipped with a CD-ROM
- drive.
-
- The primary interface to the cd.device test program is an ARexx command
- host. The ARexx port name is:
-
- cd.<instance>
-
- where <instance> is the instance number (beginning with 1) of the cd.device
- test program.
-
- To Do
- =====
-
- The following features are documented, but not implemented in the
- current version:
-
- [ ] Synchronous I/O -- all I/O is currently asynchronous (via
- exec.library/DoIO()) and the IO command is not implemented.
-
- [ ] READXL
-
- [ ] Comments in cd.c (cd.device command module) are, to say the
- least, sparse.
-
- This program is due to the very intense time pressure under which
- this test program was written (3 working days, minus time for
- administrative and other duties).
-
- Startup
- =======
-
- CLI:
- CDTest DEBUG/S,NOCD/S
-
- INPUTS
- DEBUG - Debugging mode; detailed output of
- progress through all commands
- NOCD - Do not use cd.device; all cd.device
- commands fail
-
- Device I/O
- ==========
-
- By default, cd.device uses asynchronous device I/O (via the
- exec.library/DoIO() function). However, synchronous device I/O (via the
- exec.library/SendIO(), WaitIO(), AbortIO(), and CheckIO() functions) is also
- supported.
-
- Asynchronous I/O
- ----------------
-
- To explicitly select asynchronous I/O, use the command:
-
- IO ASYNC
-
- In asynchronous I/O mode, the cd.device test program automatically sets
- up all I/O requests, executes the I/O request with exec.library/DoIO(),
- and returns the result (if any) to the ARexx script.
-
- Synchronous I/O
- ---------------
-
- To explicitly select synchronous I/O, use the command:
-
- IO SYNC
-
- The basic sequence of events necessary for synchronous I/O is:
-
- <cd.device command> /* Initialize I/O request */
- SendIO /* Send I/O request */
- WaitIO /* Wait for I/O request
- to complete and return
- result (if any) */
-
- where <cd.device command> is one of the cd.device test program commands that
- mirror cd.device I/O commands.
-
- To abort a pending I/O request, use the following sequence (after SendIO):
-
- AbortIO /* Abort I/O request */
- WaitIO /* Wait for I/O request to abort */
-
- To check whether a pending I/O request is completed, use the following
- sequence (after SendIO):
-
- CheckIO /* Abort I/O request */
- if result=1 then
- say "I/O request completed"
- else
- say "I/O request in progress"
-
- cd.device commands
- ==================
-
- ADDCHANGEINT
- ------------
-
- SYNOPSIS
- ADDCHANGEINT
-
- FUNCTION
- Add disk change interrupt. The disk change interrupt
- set-up by this function maintains the following information:
-
- o Total number of calls to interrupt handler
-
- o Number of calls with invalid is_Data
- (tested against magic cookie set up at
- ADDCHANGEINT time)
-
- INPUTS
- None
-
- RESULT
- None
-
- NOTES
-
- BUGS
-
- SEE ALSO
- REMCHANGEINT, GETCHANGEINT
-
- ADDFRAMEINT
- -----------
-
- SYNOPSIS
- ADDFRAMEINT
-
- FUNCTION
- Add frame interrupt. The frame interrupt set-up by this
- function maintains the following information:
-
- o Total number of calls to interrupt handler
-
- o Number of calls with invalid is_Data
- (tested against magic cookie set up at
- ADDFRAMEINT time)
-
- INPUTS
- None
-
- RESULT
- None
-
- NOTES
-
- BUGS
-
- SEE ALSO
- REMFRAMEINT, GETFRAMEINT
-
- ATTENUATE
- ---------
-
- SYNOPSIS
- ATTENUATE DURATION/N/A,TARGET/N/A
-
- FUNCTION
- Attenuate CD audio volume, fading from current volume to
- target volume over specified duration.
-
- INPUTS
- DURATION - Duration of fade (frames; one frame = 1/75th s)
- TARGET - Target volume (0 (mute) - 32767 (full))
-
- RESULT
- VOLUME - Current volume level (0 (mute) - 32767 (full))
-
- NOTES
- To query (without changing) the current volume level, use a
- value of -1 for TARGET.
-
- BUGS
-
- SEE ALSO
-
- CHANGENUM
- ---------
-
- SYNOPSIS
- CHANGENUM
-
- FUNCTION
- Return disk-change count.
-
- INPUTS
- None
-
- RESULT
- CHANGECOUNT - Disk-change count
-
- NOTES
-
- BUGS
-
- SEE ALSO
-
- CHANGESTATE
- -----------
-
- SYNOPSIS
- CHANGESTATE
-
- FUNCTION
- Return disk-change state.
-
- INPUTS
- None
-
- RESULT
- CHANGESTATE - Disk-change state
- (0 = disk present; !=0 = no disk present)
-
- NOTES
-
- BUGS
-
- SEE ALSO
-
- CONFIG
- ------
-
- SYNOPSIS
- CONFIG PLAYSPEED/N,READSPEED/N,READXLSPEED/N,SECTORSIZE/N,
- XLECC/S,NOXLECC/S,EJECTRESET/S,NOEJECTRESET/S
-
- FUNCTION
- Change CD-ROM drive settings.
-
- INPUTS
- PLAYSPEED - Play speed (frames per second)
- READSPEED - Data read speed (frames per seocnd)
- READXLSPEED - CD-XL read speed (frames per second)
- SECTORSIZE - Sector size (bytes per sector)
- XLECC - Enable error checking/correction for CD-XL
- NOXLECC - Disable error checking/correction for CD-XL
- EJECTRESET - Enable system reset on CD eject
- NOEJECTRESET - Disable system reset on CD eject
-
- RESULT
- None
-
- NOTES
- If an argument is not specified, the associated CD-ROM
- drive setting is unchanged.
-
- If EJECTRESET and NOEJECTRESET are both specified, a garbage
- value (0xFFFFFFFF) is passed as the value for CD_EJECTRESET tag
- to CD_CONFIG.
-
- BUGS
- This command does not work with cd.device 40.19 or earlier
- because the TAGCD_* definitions conflict with the TAG_*.
-
- SEE ALSO
-
- EJECT
- -----
-
- SYNOPSIS
- EJECT OPEN/S,CLOSE/S
-
- FUNCTION
- Open or close CD-ROM drive.
-
- INPUTS
- OPEN - Open CD-ROM drive drawer.
- CLOSE - Close CD-ROM drive drawer.
-
- RESULT
- STATE - Previous state of CD-ROM drive drawer
- (0 = closed; 1 = open)
-
- NOTES
- If neither OPEN nor CLOSE are specified, an invalid io_Length (-1)
- is set in the cd.device/CD_EJECT I/O request. This may be useful
- for testing.
-
- BUGS
-
- SEE ALSO
-
- GETGEOMETRY
- -----------
-
- SYNOPSIS
- GETGEOMETRY STEM/A
-
- FUNCTION
- Query drive geometry.
-
- INPUTS
- STEM - stem variable to store drive geometry data
-
- RESULT
- stem.SectorSize - sector size (bytes)
- stem.TotalSectors - total sector count
- stem.Cylinders - cylinder count
- stem.CylSectors - sectors per sector
- stem.Heads - head count
- stem.TrackSectors - sectors per track
- stem.BufMemType - buffer memory type
- (flag value, see MEMF_* in
- exec/types.h)
- stem.DeviceType - device type code
- (see DG_* in devices/trackdisk.h)
- stem.Removable - 0 if non-removable; !=0 if removable
-
- NOTES
-
- BUGS
-
- SEE ALSO
-
- INFO
- ----
-
- SYNOPSIS
- INFO STEM/A
-
- FUNCTION
- Query drive configuration.
-
- INPUTS
- STEM - stem variable to store
- drive geometry data
-
- RESULT
- stem.PlaySpeed - play speed (frames per second)
- stem.ReadSpeed - read speed (frames per second)
- stem.ReadXLSpeed - CD-XL read speed (frames per second)
- stem.SectorSize - sector size (bytes)
- stem.XLECC - CD-XL error checking/correction
- (0 = disabled; !=0 enabled)
- stem.EjectReset - reset on eject
- (0 = disabled; !=0 enabled)
- stem.MaxSpeed - maximum drive speed
- (frames per second)
- stem.AudioPrecision - audio volume precision
- (0 = no attenuator;
- 1 = mute only;
- other = # levels -1)
- stem.Closed - drive door closed?
- (0 = open; 1 = closed)
- stem.Disk - disk in drive?
- (0 = no disk present; 1 = disk present)
- stem.Spin - disk spinning?
- (0 = disk not spinning; 1 = disk spinning)
- stem.TOC - TOC found?
- (0 = TOC not found; 1 = TOC found)
- stem.CDROM - CD-ROM in drive?
- (0 = CD-ROM not present;
- 1 = CD-ROM present)
- stem.Playing - CD Audio playing?
- (0 = audio not playing;
- 1 = audio playing)
- stem.Paused - CD Audio paused?
- (0 = audio not paused;
- 1 = audio paused)
- stem.Search - CD Audio search?
- (0 = search off;
- 1 = search on)
- stem.Direction - CD Audio search direction
- (0 = forward;
- 1 = reverse)
-
- NOTES
-
- BUGS
-
- SEE ALSO
-
- MOTOR
- -----
-
- SYNOPSIS
- MOTOR ON/S,OFF/S
-
- FUNCTION
- Spin-up or spin-down CD-ROM drive spindle motor.
-
- INPUTS
- ON - Spin-up CD-ROM drive spindle motor.
- OFF - Spin-down CD-ROM drive spindle motor.
-
- RESULT
- STATE - Previous state of CD-ROM drive spindle motor
- (0 = off;1 = on)
-
- NOTES
- If neither ON nor OFF are specified, an invalid io_Length (-1)
- is set in the cd.device/CD_EJECT I/O request. This may be useful
- for testing.
-
- BUGS
-
- SEE ALSO
-
- PAUSE
- -----
-
- SYNOPSIS
- PAUSE ON/S,OFF/S
-
- FUNCTION
- Pause or unpause CD-ROM drive.
-
- INPUTS
- ON - Pause CD-ROM drive.
- OFF - Unpause CD-ROM drive.
-
- RESULT
- STATE - Previous pause state of CD-ROM drive.
- (0 = unpaused; 1 = paused)
-
- NOTES
- If neither ON nor OFF are specified, an invalid io_Length (-1)
- is set in the cd.device/CD_PAUSE I/O request. This may be useful
- for testing.
-
- BUGS
-
- SEE ALSO
-
- PLAYLSN
- -------
-
- SYNOPSIS
- PLAYLSN START/N/A,LENGTH/N/A
-
- FUNCTION
- Play CD audio using LSN (logical sector number) references.
-
- INPUTS
- START - Starting LSN
- LENGTH - Length of play (logical sectors)
-
- RESULT
- None
-
- NOTES
-
- BUGS
-
- SEE ALSO
- PLAYMSF
-
- PLAYMSF
- -------
-
- SYNOPSIS
- PLAYMSF START/A,LENGTH/A
-
- FUNCTION
- Play CD audio using MSF (minute/second/frame) references.
-
- INPUTS
- START - Starting MSF
- LENGTH - Length of play (MSF)
-
- RESULT
- None
-
- NOTES
- MSF values must be specified as:
- mm:ss:ff
- where <mm> is minutes, <ss> is seconds, and <ff> is frames.
- For example:
- 05:15:27
- to specify 5 minutes, 15 seconds, and 27 frames.
-
- BUGS
-
- SEE ALSO
- PLAYLSN
-
- PLAYTRACK
- ---------
-
- SYNOPSIS
- PLAYTRACK START/N/A,LENGTH/N/A
-
- FUNCTION
- Play CD audio by track.
-
- INPUTS
- START - Starting track
- LENGTH - Number of tracks to play
-
- RESULT
- None
-
- NOTES
-
- BUGS
-
- SEE ALSO
-
- PROTSTATUS
- ----------
-
- SYNOPSIS
- PROTSTATUS
-
- FUNCTION
- Query write-protection status of device.
-
- INPUTS
- None
-
- RESULT
- protected - 0 if writable; 1 if write-protected
-
- NOTES
-
- BUGS
-
- SEE ALSO
-
- QCODELSN
- --------
-
- SYNOPSIS
- QCODELSN STEM/A
-
- FUNCTION
- Read Q-code data in LSN format.
-
- INPUTS
- STEM - stem variable to store Q-code data
-
- RESULT
- stem.CtlAdr - control/address bye
- stem.Track - track number
- stem.Index - index number
- stem.Zero - "zero" byte
- stem.TrackPosition - track-relative position (LSN)
- stem.DiskPosition - disk-relative position (LSN)
-
- NOTES
-
- BUGS
-
- SEE ALSO
- QCODEMSF
-
- QCODEMSF
- --------
-
- SYNOPSIS
- QCODEMSF STEM/A
-
- FUNCTION
- Read Q-code data in MSF format.
-
- INPUTS
- STEM/A - stem variable to store Q-code data
-
- RESULT
- stem.CtlAdr - control/address bye
- stem.Track - track number
- stem.Index - index number
- stem.Zero - "zero" byte
- stem.TrackPosition.Minute - track-relative position (minute)
- stem.TrackPosition.Second - track-relative position (second)
- stem.TrackPosition.Frame - track-relative position (frame)
- stem.DiskPosition.Minute - disk-relative position (minute)
- stem.DiskPosition.Second - disk-relative position (second)
- stem.DiskPosition.Frame - disk-relative position (frame)
-
- NOTES
-
- BUGS
-
- SEE ALSO
- QCODELSN
-
- READ
- ----
-
- SYNOPSIS
- READ OFFSET/N/A,LENGTH/N/A,
- BV=BYTEVERIFY/S,WV=WORDVERIFY/S,OV=OFFSETVERIFY/S,
- START/N
-
- FUNCTION
- Read data from CD-ROM disk.
-
- If BYTE is specified, data is compared against byte in START.
-
- If WORD is specified, data is compared against word in START.
-
- If OFFSET is specified, data is compared against offset
- pattern beginning with START.
-
- INPUTS
- OFFSET - Byte offset of read
- LENGTH - Byte length of read
- BYTEVERIFY - Verify byte pattern
- WORDVERIFY - Verify word pattern
- OFFSETVERIFY - Verify offset pattern
- START - Base verify value (for
- BYTEVERIFY, WORDVERIFY,
- and OFFSETVERIFY)
-
- RESULT
- Returns 0 (RC_OK) if successful.
- Returns 5 (RC_WARN) if error detected verifying pattern.
- Returns 10 (RC_ERROR) if error reading data.
-
- NOTES
- If START is not specified with BYTEVERIFY, WORDVERIFY,
- or OFFSETVERIFY, a default of 0 is used.
-
- BUGS
-
- SEE ALSO
-
- READXL
- ------
-
- REMCHANGEINT
- ------------
-
- SYNOPSIS
- REMCHANGEINT
-
- FUNCTION
- Remove disk change interrupt handler.
-
- INPUTS
- None
-
- RESULT
- None
-
- NOTES
-
- BUGS
-
- SEE ALSO
- ADDCHANGEINT, GETCHANGEINT
-
- REMFRAMEINT
- -----------
-
- SYNOPSIS
- REMFRAMEINT
-
- FUNCTION
- Remove frame change interrupt handler.
-
- INPUTS
- None
-
- RESULT
- None
-
- NOTES
-
- BUGS
-
- SEE ALSO
- ADDFRAMEINT, GETFRAMEINT
-
- SEARCH
- ------
-
- SYNOPSIS
- SEARCH NORMAL/S,FFWD/S,FREV/S
-
- FUNCTION
- Set normal, fast-forward, or fast-reverse audio play mode.
-
- INPUTS
- NORMAL - Select normal audio play mode.
- FFWD - Select fast-forward audio play mode.
- FREV - Select fast-reverse audio play mode.
-
- RESULT
-
- NOTES
- If none of NORMAL, FFWD, or FREV are specified, the
- io_Length field is set to an invalid value (-1). This may be
- useful for testing.
-
- BUGS
-
- SEE ALSO
-
- TOCLSN
- ------
-
- SYNOPSIS
- TOCLSN STEM/A,ENTRIES/N/A,BEGIN/N/A
-
- FUNCTION
- Fetch table of contents (TOC) in LSN format.
-
- INPUTS
- STEM - Stem variable to store TOC data
- ENTRIES - Number of entries to fetch
- BEGIN - Starting track number
- (0 to include summary)
-
- RESULTS
- stem.Summary.FirstTrack - First track number
- stem.Summary.LastTrack - Last track number
- stem.Summary.LeadOut - Start of lead-out track (LSN)
-
- stem.n.CtlAdr - Control/address byte for track
- stem.n.Track - Track number for track
- stem.n.Position - Track position (LSN)
-
- where n is stem entry.
-
- NOTES
-
- EXAMPLE
- TOCLSN myToc 100 0 /* To fetch full table of contents */
- say myToc.Summary.LeadOut /* Output leadout */
- say myToc.1.Track /* Output track number of track 1 */
- say myToc.5.Position /* Output LSN position of track 5 */
-
- BUGS
-
- SEE ALSO
- TOCMSF
-
- TOCMSF
- ------
-
- SYNOPSIS
- TOCMSF STEM/A,ENTRIES/N/A,BEGIN/N/A
-
- FUNCTION
- Fetch table of contents (TOC) in MSF format.
-
- INPUTS
- STEM - Stem variable to store TOC data
- ENTRIES - Number of entries to fetch
- BEGIN - Starting track number
- (0 to include summary)
-
- RESULTS
- stem.Summary.FirstTrack - First track number
- stem.Summary.LastTrack - Last track number
- stem.Summary.LeadOut.Minute - Start of lead-out track (minute)
- stem.Summary.LeadOut.Second - Start of lead-out track (second)
- stem.Summary.LeadOut.Frame - Start of lead-out track (frame)
-
- stem.n.CtlAdr - Control/address byte for track
- stem.n.Track - Track number for track
- stem.n.Position.Minute - Track position (minute)
- stem.n.Position.Second - Track position (second)
- stem.n.Position.Frame - Track position (frame)
-
- where n is stem entry.
-
- NOTES
-
- EXAMPLE
- TOCLSN myToc 100 0 /* To fetch full table of contents */
- say myToc.Summary.LeadOut /* Output leadout */
- say myToc.1.Track /* Output track number of track 1 */
- say myToc.5.Position.Minute /* Output minute position of track 5 */
- say myToc.5.Position.Second /* Output second position of track 5 */
-
- BUGS
-
- SEE ALSO
-
- I/O commands
- ============
-
- IO
- --
-
- SYNOPSIS
- IO SYNC/S,ASYNC/S
-
- FUNCTION
- Select synchronous or asynchronous I/O to cd.device.
-
- INPUTS
- SYNC - Select synchronous I/O
- ASYNC - Select asynchronous I/O
-
- RESULT
- None
-
- NOTES
-
- EXAMPLE
-
- BUGS
-
- SEE ALSO
-
- AbortIO
- -------
-
- CheckIO
- -------
-
- DoIO
- ----
-
- SendIO
- ------
-
- WaitIO
- ------
-
- Support Commands
- ================
-
- GETCHANGEINT
- ------------
-
- SYNOPSIS
- GETCHANGEINT STEM/A
-
- FUNCTION
- Get data collected by disk change interrupt handler.
-
- INPUTS
- STEM - stem variable to store disk
- change interrupt data
-
- RESULT
- stem.Call - Total number of calls to
- disk change interrupt handler
- stem.BadData - Number of calls to disk change
- interrupt handler with bad
- interrupt data
-
- NOTES
-
- BUGS
-
- SEE ALSO
- ADDCHANGEINT, REMCHANGEINT
-
- GETFRAMEINT
- -----------
-
- SYNOPSIS
- GETFRAMEINT STEM/A
-
- FUNCTION
- Get data collected by frame interrupt handler.
-
- INPUTS
- STEM - stem variable to store frame
- interrupt data
-
- RESULT
- stem.Call - Total number of calls to
- frame interrupt handler
- stem.BadData - Number of calls to frame
- interrupt handler with bad
- interrupt data
-
- NOTES
-
- BUGS
-
- SEE ALSO
- ADDFRAMEINT, REMFRAMEINT
-
- QUIT
- ----
-
- SYNOPSIS
- QUIT
-
- FUNCTION
- Terminate cd.device test program.
-
- INPUTS
- None
-
- RESULT
- None
-
- NOTES
-
- BUGS
- I certainly hope not!
-
- SEE ALSO
-